package com.feng.gaoerfu.adapter;

import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.feng.gaoerfu.R;
import com.feng.gaoerfu.bean.BallPersonData;

import java.util.List;

/**
 * @time 2017/9/8 0008 16:09
 */

public class MyBallFriendListAdapter extends BaseQuickAdapter<BallPersonData> {

    private final List<BallPersonData> mList;

    public MyBallFriendListAdapter(int layoutResId, List<BallPersonData> list) {
        super(layoutResId, list);
        this.mList = list;
    }

    @Override
    protected void convert(BaseViewHolder help, BallPersonData data) {
        help.setText(R.id.item_tv_name, data.name)
                .setImageResource(R.id.item_iv_icon, data.drawable);
        ImageView view = help.getView(R.id.item_iv_check);
        if (data.isSelected) {
            view.setImageResource(R.drawable.has_selected);
        } else {
            view.setImageResource(R.drawable.has_no_select);
        }
    }

    @Override
    public void setOnRecyclerViewItemClickListener(OnRecyclerViewItemClickListener listener) {
        super.setOnRecyclerViewItemClickListener(listener);

    }
}
